import Dialog from "../../../../component/vant/dialog/dialog";

let app = getApp()

Page({

    /**
     * 页面的初始数据
     */
    data: {
        customerBillId: null,
        customerBill: {},
        //action-sheet
        actions: [
            {name: '新增', type: "add"},
            {name: '撤销', type: "cancel"},
            {name: '工作台', type: "homepage"},
        ],
        actionSheetShow: false,
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        let customerBillId = options.customerBillId
        this.data.customerBillId = customerBillId
        if (customerBillId && customerBillId != null) {
            this.queryData(customerBillId)
        }
    },
    queryData() {
        let _this = this
        app.formGet('/app/customer/bill/detail?id=' + this.data.customerBillId, null).then(res => {
            if (res.code === 0) {
                let customerBill = res.data
                _this.setData({
                    customerBill: customerBill
                });
            } else {
                app.message(res.message, 'error')
            }
        }).catch(e => {
            _this.setData({
                spinShow: false
            });
            app.message(e, 'error')
        })
    },
})
